import request from '../utils/request'

// 获取配送员信息
export function getDeliveryPersonInfo() {
  return request({
    url: '/delivery/my',
    method: 'get'
  })
}

// 更新配送员状态
export function updateDeliveryStatus(status) {
  return request({
    url: '/delivery/status',
    method: 'put',
    data: { status }
  })
}

// 更新配送员信息
export function updateDeliveryInfo(data) {
  return request({
    url: '/delivery/profile',
    method: 'put',
    data
  })
}

// 获取配送员列表
export function getDeliveryPersons(params) {
  return request({
    url: '/delivery',
    method: 'get',
    params
  })
}

// 获取配送员详情
export function getDeliveryPersonById(id) {
  return request({
    url: `/delivery/${id}`,
    method: 'get'
  })
}

// 获取可用配送员
export function getAvailableDeliveryPersons() {
  return request({
    url: '/delivery/available',
    method: 'get'
  })
}
